//    Copyright (C) Kherty.  All rights reserved.
using OpenLS.Core.Serialization;

namespace OpenLS.Drawing
{
    internal class GroupShapeNonVisual : IOfficeXmlSerializable
    {
        private NonVisualGroupDrawingShapeProps cNvGrpSpPr;
        private NonVisualDrawingProperties cNvPr;

        public NonVisualDrawingProperties NonVisualDrawingProps
        {
            get { return cNvPr; }
            set { cNvPr = value; }
        }

        public NonVisualGroupDrawingShapeProps NonVisualGroupDrawingShapeProps
        {
            get { return cNvGrpSpPr; }
            set { cNvGrpSpPr = value; }
        }

        #region IOfficeXmlSerializable Members

        void IOfficeXmlSerializable.ReadXml(ReadContext context)
        {
            using (var c = context.Read("nvGrpSpPr"))
            {
                NonVisualDrawingProps = c.ReadElement<NonVisualDrawingProperties>();
                NonVisualGroupDrawingShapeProps = c.ReadElement<NonVisualGroupDrawingShapeProps>();
            }
        }

        void IOfficeXmlSerializable.WriteXml(WriteContext context)
        {
            using (WriteContext c = context.Write("nvGrpSpPr"))
            {
                c.WriteElement(NonVisualDrawingProps);
                c.WriteElement(NonVisualGroupDrawingShapeProps);
            }
        }

        #endregion
    }
}